#ifndef _DEVLIST_INCLUDED_
#define _DEVLIST_INCLUDED_

#include "fs.hpp"
#include "common.hpp"

class DevList:public QAbstractTableModel
{	
	QList<Device> devices;

public:
	bool getDevice(QModelIndex& index, Device& d)
	{
		if(!inbounds(index.row(), 0, devices.size()))
			return false;
		d = devices[index.row()];
		return true;
	}
	int columnCount(const QModelIndex &) const{ return Max; };
	int rowCount(const QModelIndex &) const{ return devices.size(); };
	QVariant data(const QModelIndex &index, int) const;
	QVariant headerData(int, Qt::Orientation, int) const;
	DevList();

	enum {
		file,
		diskModel,
		diskSerial,
		diskSize,
		fsType,
		fsSize,
		fsLabel,
		Max,
	};

private:
	void scanPartitions();
};

#endif //_DEVLIST_INCLUDED_
